package com.collection;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * 配置文件读取
 *  load(inputStream input)
 *  load(Reader reader)
 *  loadFromXMl(inputStream input)
 *
 * @author jiangbang
 * @date 2016/5/31
 */
public class Perperties3 {
    public static void main(String[] args) throws IOException {
        Properties properties = new Properties();
        //绝对路径
        properties.load(new FileReader("e:/db.properties"));
        //读取相对路径
        properties.load(new FileReader("db.properties"));
        //类相对路径的 /bin
        properties.load(Perperties3.class.getResourceAsStream("com/collection/db.properties"));
    }
}
